home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / WMOVE.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  61 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef wmove
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_wmove = "$Header: c:/curses/portable/RCS/wmove.c%v 2.0 1992/11/15 03:29:27 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   wmove()      - Move cursor in window
  15.  
  16.   X/Open Description:
  17.        The cursor associated with the window is moved to the given
  18.        location.  This does not move the physical cursor of the
  19.        terminal until refresh() is called.  The position specified is
  20.        relative to the upper left corner of the window, which is (0,0).
  21.  
  22.        NOTE: move() is a macro.
  23.  
  24.   PDCurses Description:
  25.        There may be additional [window oriented] move routines associated
  26.        with other sections of the curses library.  See those sections for
  27.        details.
  28.  
  29.   X/Open Return Value:
  30.        These functions return OK on success and ERR on error.
  31.  
  32.   PDCurses Errors:
  33.        It is an error to call this function with a NULL window pointer.
  34.  
  35.   Portability:
  36.        PDCurses        int wmove( WINDOW* win, int y, int x );
  37.        X/Open Dec '88  int wmove( WINDOW* win, int y, int x );
  38.        BSD Curses      int wmove( WINDOW* win, int y, int x );
  39.        SYS V Curses    int wmove( WINDOW* win, int y, int x );
  40.  
  41. **man-end**********************************************************************/
  42.  
  43. int    wmove(WINDOW *win, int y, int x)
  44. {
  45.        if (win == (WINDOW *)NULL)
  46.                return( ERR );
  47.  
  48.        if ((x < 0) ||
  49.            (y < 0) ||
  50.            (x >= win->_maxx) ||
  51.            (y >= win->_maxy) ||
  52.            (y < win->_tmarg) ||
  53.            (y > win->_bmarg))
  54.        {
  55.                return( ERR );
  56.        }
  57.        win->_curx = x;
  58.        win->_cury = y;
  59.        return( OK );
  60. }
  61.